package com.hmall.api.order;

import com.hmall.api.user.dto.OrderFormDTO;
import com.hmall.api.user.vo.OrderVO;
import com.hmall.common.utils.BeanUtils;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Date 2025/11/9 23:49
 */
@FeignClient(name = "order-service",path = "/orders")
public interface OrderClient {
    @ApiOperation("根据id查询订单")
    @GetMapping("{id}")
    OrderVO queryOrderById(@Param("订单id")@PathVariable("id") Long orderId) ;

    @ApiOperation("创建订单")
    @PostMapping
    Long createOrder(@RequestBody OrderFormDTO orderFormDTO);

    @ApiOperation("标记订单已支付")
    @ApiImplicitParam(name = "orderId", value = "订单id", paramType = "path")
    @PutMapping("/{orderId}")
    void markOrderPaySuccess(@PathVariable("orderId") Long orderId) ;
}
